close all

clear all
fname = {'test_stoch_1', 'test_hals_1'};
column = [3 4];

marker = {'-r', '--g', '-c', '-b', '-r'};

figure
for i = 1:length(fname)
    a{i} = importdata(['../cpp/' fname{i}]);
    I = a{i}(:,2) < 100;
    semilogy(a{i}(I,2), a{i}(I,column(i)), marker{i}, 'LineWidth', 2); hold on
end
legend('StochHALS', 'ParHALS', 'Location', 'NorthEast');
xlabel('time (s)')
ylabel('RMSE')
title('10000 \times 10000 P = 1');

print(gcf, '-depsc', '-r300', '../figures/test_stoch_hals_1.eps');
print(gcf, '-dpdf', '-r300', '../figures/test_stoch_hals_1.pdf');


fname = {'test_stoch_2', 'test_hals_2'};
column = [3 4];

marker = {'-r', '--g', '-c', '-b', '-r'};

figure
for i = 1:length(fname)
    a{i} = importdata(['../cpp/' fname{i}]);
    I = a{i}(:,2) < 100;
    semilogy(a{i}(I,2), a{i}(I,column(i)), marker{i}, 'LineWidth', 2); hold on
end
legend('StochHALS', 'ParHALS', 'Location', 'NorthEast');
xlabel('time (s)')
ylabel('RMSE')
title('10000 \times 10000 P = 2');

print(gcf, '-depsc', '-r300', '../figures/test_stoch_hals_2.eps');
print(gcf, '-dpdf', '-r300', '../figures/test_stoch_hals_2.pdf');

clear all
fname = {'test_stoch_4', 'test_hals_4'};
column = [3 4];

marker = {'-r', '--g', '-c', '-b', '-r'};

figure
for i = 1:length(fname)
    a{i} = importdata(['../cpp/' fname{i}]);
    I = a{i}(:,2) < 100;
    semilogy(a{i}(I,2), a{i}(I,column(i)), marker{i}, 'LineWidth', 2); hold on
end
legend('StochHALS', 'ParHALS', 'Location', 'NorthEast');
xlabel('time (s)')
ylabel('RMSE')
title('10000 \times 10000 P = 4');

print(gcf, '-depsc', '-r300', '../figures/test_stoch_hals_4.eps');
print(gcf, '-dpdf', '-r300', '../figures/test_stoch_hals_4.pdf');

clear all
fname = {'test_stoch_8', 'test_hals_8'};
column = [3 4];

marker = {'-r', '--g', '-c', '-b', '-r'};

figure
for i = 1:length(fname)
    a{i} = importdata(['../cpp/' fname{i}]);
    I = a{i}(:,2) < 100;
    semilogy(a{i}(I,2), a{i}(I,column(i)), marker{i}, 'LineWidth', 2); hold on
end
legend('StochHALS', 'ParHALS', 'Location', 'NorthEast');
xlabel('time (s)')
ylabel('RMSE')
title('10000 \times 10000 P = 8');

print(gcf, '-depsc', '-r300', '../figures/test_stoch_hals_8.eps');
print(gcf, '-dpdf', '-r300', '../figures/test_stoch_hals_8.pdf');
